#include "vinoui.h"

VinoUi::VinoUi(QWidget *parent) : QWidget(parent)
{
    initUi();
}

void VinoUi::initUi()
{
    QVBoxLayout *vLyt = new QVBoxLayout(this);
    vLyt->setContentsMargins(0, 0, 0, 0);

    SettingGroup *mVinoFrame = new SettingGroup;
    mVinoTitleLabel = new TitleLabel(this);
    mVinoTitleLabel->setText(tr("Remote Desktop"));

    mEnableWidget = new SwitchWidget(tr("Allow others to view your desktop"));
    //~ contents_path /Vino/Allow connection to control screen
    mViewWidget = new SwitchWidget(tr("Allow connection to control screen"));
    //~ contents_path /Vino/You must confirm every visit for this machine
    mSecurityWidget = new SwitchWidget(tr("You must confirm every visit for this machine"));
    //~ contents_path /Vino/Require user to enter this password:
    mSecurityPwdWidget = new SwitchWidget(tr("Require user to enter this password: "));
    mPwdinputBtn = new QPushButton(this);
    mSecurityPwdWidget->insertWidget(1, mPwdinputBtn);


    mVinoFrame->addWidget(mEnableWidget);
    mVinoFrame->addWidget(mViewWidget);
    mVinoFrame->addWidget(mSecurityWidget);
    mVinoFrame->addWidget(mSecurityPwdWidget);

    vLyt->addWidget(mVinoTitleLabel);
    vLyt->addWidget(mVinoFrame);
    vLyt->addStretch();
}

void VinoUi::setFrameVisible(bool visible)
{
    mEnableWidget->setChecked(visible);
    mViewWidget->setVisible(visible);
    mSecurityWidget->setVisible(visible);
    mSecurityPwdWidget->setVisible(visible);
}
